package com.service.weChatWifiLogin.controller;

import com.service.config.utils.RedisUtil;
import com.service.config.utils.Result;
import com.service.config.utils.UserTokenManager;

import com.service.weChatWifiLogin.service.VFilePhysicsInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * 物理文件消息表(VFilePhysicsInfo)表控制层
 *
 * @author makejava
 * @since 2021-05-18 19:56:30
 */
@RestController
@RequestMapping("vFilePhysicsInfo")
@Api(value = "上传logo",produces = "上传logo",tags = "审核管理接口")
public class VFilePhysicsInfoController {
    /**
     * 服务对象
     */
    @Resource
    private VFilePhysicsInfoService vFilePhysicsInfoService;
    @Resource
    private RedisUtil redisUtil;

    /**
     * 图片上传 需要审核
     * @param file
     * @param shopId
     * @param isLogo
     * @return ok
     * @throws Exception
     */
    @ApiOperation(value = "店铺logo图片/营销图片上传")
    @RequestMapping(value = "uploadServiceLogo", method = RequestMethod.POST)
    @ResponseBody
    public Result uploadServiceLogo(@RequestParam("file")  @ApiParam("文件")MultipartFile file,
                                    @RequestParam("shopId")  @ApiParam("店铺id")String shopId,
                                    @RequestParam("isLogo")  @ApiParam("true--logo false--营销图片")boolean isLogo) throws Exception {
        return Result.ok().setData(vFilePhysicsInfoService.uploadServiceLogo(file,shopId,isLogo));
    }
}
